#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define SIZE 1024

const char* HostName()
{
  char* hostname=getenv("HOSTNAME");
  if(hostname) return hostname;
  else return "None";
}

const char* UserName()
{
  char* username=getenv("USER");
  if(username) return username;
  else return "None";
}

const char* CurrentWorkDir()
{
  char* currentworkdir=getenv("PWD");
  if(currentworkdir) return currentworkdir;
  else return "None";
}
int main()
{
  char commandline[SIZE];
  printf("[%s@%s %s]$ ",UserName(),HostName(),CurrentWorkDir());
  fgets(commandline,SIZE,stdin);
  commandline[strlen(commandline)-1]=0;
  printf("test:%s\n",commandline);
  return 0;
}
